// Read file
// http://www.cplusplus.com/doc/tutorial/files/

#include <iostream>
#include <fstream>
#include <string>
using namespace std;

int main () {

	float num;
	float eps = 1e-5;
	string pathIn;
	string pathOut;

	//path = ".\\input\\info1.txt";
	//path = ".\\input\\info2.txt";
	string fileNum = "2";
	pathIn = ".\\input\\info" + fileNum +  ".txt";
	pathOut = ".\\input\\info"+ fileNum +  "_re.txt";

	ifstream in (pathIn);
	ofstream out(pathOut);

	if (in.is_open() && out.is_open())
	{
		while ( in.good() )
		{
			in >> num;
			
			// Processing

			if( fabs(num - 0)< eps)
			{
				out << num << endl;
			}
			else if( num < 270 )
			{
				out << num + 90 << endl;
			}
			else 
			{
				out << num - 270 << endl;
			}
		}
		in.close();
	}
	else cout << "Unable to open file\n"; 

	return 0;
}

